﻿using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using HslCommunication.BasicFramework;
using HslCommunication.Core;
using HslCommunication.Core.IMessage;
using HslCommunication.Core.Net;

namespace HslCommunication.Instrument.DLT
{
	/// <summary>
	/// 基于多功能电能表通信协议实现的通讯类，参考的文档是DLT645-2007，主要实现了对电表数据的读取和一些功能方法，
	/// 在点对点模式下，需要在连接后调用 <see cref="M:HslCommunication.Instrument.DLT.DLT645OverTcp.ReadAddress" /> 方法，数据标识格式为 00-00-00-00，具体参照文档手册。<br />
	/// The communication type based on the communication protocol of the multifunctional electric energy meter. 
	/// The reference document is DLT645-2007, which mainly realizes the reading of the electric meter data and some functional methods. 
	/// In the point-to-point mode, you need to call <see cref="M:HslCommunication.Instrument.DLT.DLT645OverTcp.ReadAddress" /> method after connect the device.
	/// the data identification format is 00-00-00-00, refer to the documentation manual for details.
	/// </summary>
	/// <remarks>
	/// 如果一对多的模式，地址可以携带地址域访问，例如 "s=2;00-00-00-00"，主要使用 <see cref="M:HslCommunication.Instrument.DLT.DLT645OverTcp.ReadDouble(System.String,System.UInt16)" /> 方法来读取浮点数，
	/// <see cref="M:HslCommunication.Core.Net.NetworkDeviceBase.ReadString(System.String,System.UInt16)" /> 方法来读取字符串
	/// </remarks>
	// Token: 0x020000ED RID: 237
	public class DLT645OverTcp : NetworkDeviceBase
	{
		/// <summary>
		/// 指定IP地址，端口，地址域，密码，操作者代码来实例化一个对象<br />
		/// Specify the IP address, port, address field, password, and operator code to instantiate an object
		/// </summary>
		/// <param name="ipAddress">TcpServer的IP地址</param>
		/// <param name="port">TcpServer的端口</param>
		/// <param name="station">设备的站号信息</param>
		/// <param name="password">密码，写入的时候进行验证的信息</param>
		/// <param name="opCode">操作者代码</param>
		// Token: 0x06001425 RID: 5157 RVA: 0x000685E0 File Offset: 0x000667E0
		public DLT645OverTcp(string ipAddress, int port = 502, string station = "1", string password = "", string opCode = "")
		{
			this.IpAddress = ipAddress;
			this.Port = port;
			base.WordLength = 1;
			base.ByteTransform = new ReverseWordTransform();
			this.station = station;
			this.password = (string.IsNullOrEmpty(password) ? "00000000" : password);
			this.opCode = (string.IsNullOrEmpty(opCode) ? "00000000" : opCode);
		}

		/// <inheritdoc />
		// Token: 0x06001426 RID: 5158 RVA: 0x00068671 File Offset: 0x00066871
		protected override INetMessage GetNewNetMessage()
		{
			return new DLT645Message();
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.ActiveDeveice" />
		// Token: 0x06001427 RID: 5159 RVA: 0x00068678 File Offset: 0x00066878
		public OperateResult ActiveDeveice()
		{
			return base.ReadFromCoreServer(new byte[]
			{
				254,
				254,
				254,
				254
			}, false);
		}

		// Token: 0x06001428 RID: 5160 RVA: 0x00068694 File Offset: 0x00066894
		private OperateResult<byte[]> ReadWithAddress(string address, byte[] dataArea)
		{
			OperateResult<byte[]> operateResult = DLT645.BuildEntireCommand(address, 17, dataArea);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = operateResult2;
				}
				else
				{
					OperateResult operateResult3 = DLT645.CheckResponse(operateResult2.Content);
					bool flag3 = !operateResult3.IsSuccess;
					if (flag3)
					{
						result = OperateResult.CreateFailedResult<byte[]>(operateResult3);
					}
					else
					{
						bool flag4 = operateResult2.Content.Length < 16;
						if (flag4)
						{
							result = OperateResult.CreateSuccessResult<byte[]>(new byte[0]);
						}
						else
						{
							result = OperateResult.CreateSuccessResult<byte[]>(operateResult2.Content.SelectMiddle(14, operateResult2.Content.Length - 16));
						}
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.Read(System.String,System.UInt16)" />
		// Token: 0x06001429 RID: 5161 RVA: 0x0006874C File Offset: 0x0006694C
		public override OperateResult<byte[]> Read(string address, ushort length)
		{
			OperateResult<string, byte[]> operateResult = DLT645.AnalysisBytesAddress(address, this.station, length);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				result = this.ReadWithAddress(operateResult.Content1, operateResult.Content2);
			}
			return result;
		}

		/// <inheritdoc />
		// Token: 0x0600142A RID: 5162 RVA: 0x00068794 File Offset: 0x00066994
		public override OperateResult<double[]> ReadDouble(string address, ushort length)
		{
			OperateResult<string, byte[]> operateResult = DLT645.AnalysisBytesAddress(address, this.station, length);
			bool flag = !operateResult.IsSuccess;
			OperateResult<double[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<double[]>(operateResult);
			}
			else
			{
				OperateResult<byte[]> operateResult2 = this.ReadWithAddress(operateResult.Content1, operateResult.Content2);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = OperateResult.CreateFailedResult<double[]>(operateResult2);
				}
				else
				{
					result = DLTTransform.TransDoubleFromDLt(operateResult2.Content, length, DLT645.GetFormatWithDataArea(operateResult.Content2));
				}
			}
			return result;
		}

		/// <inheritdoc />
		// Token: 0x0600142B RID: 5163 RVA: 0x0006880C File Offset: 0x00066A0C
		public override OperateResult<string> ReadString(string address, ushort length, Encoding encoding)
		{
			OperateResult<byte[]> operateResult = this.Read(address, 1);
			bool flag = !operateResult.IsSuccess;
			OperateResult<string> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<string>(operateResult);
			}
			else
			{
				result = DLTTransform.TransStringFromDLt(operateResult.Content, length);
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.ActiveDeveice" />
		// Token: 0x0600142C RID: 5164 RVA: 0x0006884C File Offset: 0x00066A4C
		[DebuggerStepThrough]
		public Task<OperateResult> ActiveDeveiceAsync()
		{
			DLT645OverTcp.<ActiveDeveiceAsync>d__7 <ActiveDeveiceAsync>d__ = new DLT645OverTcp.<ActiveDeveiceAsync>d__7();
			<ActiveDeveiceAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<ActiveDeveiceAsync>d__.<>4__this = this;
			<ActiveDeveiceAsync>d__.<>1__state = -1;
			<ActiveDeveiceAsync>d__.<>t__builder.Start<DLT645OverTcp.<ActiveDeveiceAsync>d__7>(ref <ActiveDeveiceAsync>d__);
			return <ActiveDeveiceAsync>d__.<>t__builder.Task;
		}

		// Token: 0x0600142D RID: 5165 RVA: 0x00068890 File Offset: 0x00066A90
		[DebuggerStepThrough]
		private Task<OperateResult<byte[]>> ReadWithAddressAsync(string address, byte[] dataArea)
		{
			DLT645OverTcp.<ReadWithAddressAsync>d__8 <ReadWithAddressAsync>d__ = new DLT645OverTcp.<ReadWithAddressAsync>d__8();
			<ReadWithAddressAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<byte[]>>.Create();
			<ReadWithAddressAsync>d__.<>4__this = this;
			<ReadWithAddressAsync>d__.address = address;
			<ReadWithAddressAsync>d__.dataArea = dataArea;
			<ReadWithAddressAsync>d__.<>1__state = -1;
			<ReadWithAddressAsync>d__.<>t__builder.Start<DLT645OverTcp.<ReadWithAddressAsync>d__8>(ref <ReadWithAddressAsync>d__);
			return <ReadWithAddressAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.Read(System.String,System.UInt16)" />
		// Token: 0x0600142E RID: 5166 RVA: 0x000688E4 File Offset: 0x00066AE4
		[DebuggerStepThrough]
		public override Task<OperateResult<byte[]>> ReadAsync(string address, ushort length)
		{
			DLT645OverTcp.<ReadAsync>d__9 <ReadAsync>d__ = new DLT645OverTcp.<ReadAsync>d__9();
			<ReadAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<byte[]>>.Create();
			<ReadAsync>d__.<>4__this = this;
			<ReadAsync>d__.address = address;
			<ReadAsync>d__.length = length;
			<ReadAsync>d__.<>1__state = -1;
			<ReadAsync>d__.<>t__builder.Start<DLT645OverTcp.<ReadAsync>d__9>(ref <ReadAsync>d__);
			return <ReadAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645OverTcp.ReadDouble(System.String,System.UInt16)" />
		// Token: 0x0600142F RID: 5167 RVA: 0x00068938 File Offset: 0x00066B38
		[DebuggerStepThrough]
		public override Task<OperateResult<double[]>> ReadDoubleAsync(string address, ushort length)
		{
			DLT645OverTcp.<ReadDoubleAsync>d__10 <ReadDoubleAsync>d__ = new DLT645OverTcp.<ReadDoubleAsync>d__10();
			<ReadDoubleAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<double[]>>.Create();
			<ReadDoubleAsync>d__.<>4__this = this;
			<ReadDoubleAsync>d__.address = address;
			<ReadDoubleAsync>d__.length = length;
			<ReadDoubleAsync>d__.<>1__state = -1;
			<ReadDoubleAsync>d__.<>t__builder.Start<DLT645OverTcp.<ReadDoubleAsync>d__10>(ref <ReadDoubleAsync>d__);
			return <ReadDoubleAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc />
		// Token: 0x06001430 RID: 5168 RVA: 0x0006898C File Offset: 0x00066B8C
		[DebuggerStepThrough]
		public override Task<OperateResult<string>> ReadStringAsync(string address, ushort length, Encoding encoding)
		{
			DLT645OverTcp.<ReadStringAsync>d__11 <ReadStringAsync>d__ = new DLT645OverTcp.<ReadStringAsync>d__11();
			<ReadStringAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<string>>.Create();
			<ReadStringAsync>d__.<>4__this = this;
			<ReadStringAsync>d__.address = address;
			<ReadStringAsync>d__.length = length;
			<ReadStringAsync>d__.encoding = encoding;
			<ReadStringAsync>d__.<>1__state = -1;
			<ReadStringAsync>d__.<>t__builder.Start<DLT645OverTcp.<ReadStringAsync>d__11>(ref <ReadStringAsync>d__);
			return <ReadStringAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.Write(System.String,System.Byte[])" />
		// Token: 0x06001431 RID: 5169 RVA: 0x000689E8 File Offset: 0x00066BE8
		public override OperateResult Write(string address, byte[] value)
		{
			OperateResult<string, byte[]> operateResult = DLT645.AnalysisBytesAddress(address, this.station, 1);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				byte[] dataArea = SoftBasic.SpliceArray<byte>(new byte[][]
				{
					operateResult.Content2,
					this.password.ToHexBytes(),
					this.opCode.ToHexBytes(),
					value
				});
				OperateResult<byte[]> operateResult2 = DLT645.BuildEntireCommand(operateResult.Content1, 21, dataArea);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = operateResult2;
				}
				else
				{
					OperateResult<byte[]> operateResult3 = base.ReadFromCoreServer(operateResult2.Content);
					bool flag3 = !operateResult3.IsSuccess;
					if (flag3)
					{
						result = operateResult3;
					}
					else
					{
						result = DLT645.CheckResponse(operateResult3.Content);
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.ReadAddress" />
		// Token: 0x06001432 RID: 5170 RVA: 0x00068AAC File Offset: 0x00066CAC
		public OperateResult<string> ReadAddress()
		{
			OperateResult<byte[]> operateResult = DLT645.BuildEntireCommand("AAAAAAAAAAAA", 19, null);
			bool flag = !operateResult.IsSuccess;
			OperateResult<string> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<string>(operateResult);
			}
			else
			{
				OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = OperateResult.CreateFailedResult<string>(operateResult2);
				}
				else
				{
					OperateResult operateResult3 = DLT645.CheckResponse(operateResult2.Content);
					bool flag3 = !operateResult3.IsSuccess;
					if (flag3)
					{
						result = OperateResult.CreateFailedResult<string>(operateResult3);
					}
					else
					{
						this.station = Enumerable.ToArray<byte>(Enumerable.Reverse<byte>(operateResult2.Content.SelectMiddle(1, 6))).ToHexString();
						result = OperateResult.CreateSuccessResult<string>(Enumerable.ToArray<byte>(Enumerable.Reverse<byte>(operateResult2.Content.SelectMiddle(1, 6))).ToHexString());
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.WriteAddress(System.String)" />
		// Token: 0x06001433 RID: 5171 RVA: 0x00068B78 File Offset: 0x00066D78
		public OperateResult WriteAddress(string address)
		{
			OperateResult<byte[]> addressByteFromString = DLT645.GetAddressByteFromString(address);
			bool flag = !addressByteFromString.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = addressByteFromString;
			}
			else
			{
				OperateResult<byte[]> operateResult = DLT645.BuildEntireCommand("AAAAAAAAAAAA", 21, addressByteFromString.Content);
				bool flag2 = !operateResult.IsSuccess;
				if (flag2)
				{
					result = operateResult;
				}
				else
				{
					OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
					OperateResult operateResult3 = DLT645.CheckResponse(operateResult2.Content);
					bool flag3 = !operateResult3.IsSuccess;
					if (flag3)
					{
						result = operateResult3;
					}
					else
					{
						bool flag4 = SoftBasic.IsTwoBytesEquel(operateResult2.Content.SelectMiddle(1, 6), DLT645.GetAddressByteFromString(address).Content);
						if (flag4)
						{
							result = OperateResult.CreateSuccessResult();
						}
						else
						{
							result = new OperateResult(StringResources.Language.DLTErrorWriteReadCheckFailed);
						}
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.BroadcastTime(System.DateTime)" />
		// Token: 0x06001434 RID: 5172 RVA: 0x00068C3C File Offset: 0x00066E3C
		public OperateResult BroadcastTime(DateTime dateTime)
		{
			string value = string.Format("{0:D2}{1:D2}{2:D2}{3:D2}{4:D2}{5:D2}", new object[]
			{
				dateTime.Second,
				dateTime.Minute,
				dateTime.Hour,
				dateTime.Day,
				dateTime.Month,
				dateTime.Year % 100
			});
			OperateResult<byte[]> operateResult = DLT645.BuildEntireCommand("999999999999", 8, value.ToHexBytes());
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				result = base.ReadFromCoreServer(operateResult.Content, false);
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.FreezeCommand(System.String)" />
		// Token: 0x06001435 RID: 5173 RVA: 0x00068CEC File Offset: 0x00066EEC
		public OperateResult FreezeCommand(string dataArea)
		{
			OperateResult<string, byte[]> operateResult = DLT645.AnalysisBytesAddress(dataArea, this.station, 1);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				OperateResult<byte[]> operateResult2 = DLT645.BuildEntireCommand(operateResult.Content1, 22, operateResult.Content2);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = operateResult2;
				}
				else
				{
					bool flag3 = operateResult.Content1 == "999999999999";
					if (flag3)
					{
						result = base.ReadFromCoreServer(operateResult2.Content, false);
					}
					else
					{
						OperateResult<byte[]> operateResult3 = base.ReadFromCoreServer(operateResult2.Content);
						bool flag4 = !operateResult3.IsSuccess;
						if (flag4)
						{
							result = operateResult3;
						}
						else
						{
							result = DLT645.CheckResponse(operateResult3.Content);
						}
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.ChangeBaudRate(System.String)" />
		// Token: 0x06001436 RID: 5174 RVA: 0x00068DA4 File Offset: 0x00066FA4
		public OperateResult ChangeBaudRate(string baudRate)
		{
			OperateResult<string, int> operateResult = DLT645.AnalysisIntegerAddress(baudRate, this.station);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				int content = operateResult.Content2;
				int num = content;
				byte b;
				if (num <= 2400)
				{
					if (num == 600)
					{
						b = 2;
						goto IL_AF;
					}
					if (num == 1200)
					{
						b = 4;
						goto IL_AF;
					}
					if (num == 2400)
					{
						b = 8;
						goto IL_AF;
					}
				}
				else
				{
					if (num == 4800)
					{
						b = 16;
						goto IL_AF;
					}
					if (num == 9600)
					{
						b = 32;
						goto IL_AF;
					}
					if (num == 19200)
					{
						b = 64;
						goto IL_AF;
					}
				}
				return new OperateResult(StringResources.Language.NotSupportedFunction);
				IL_AF:
				OperateResult<byte[]> operateResult2 = DLT645.BuildEntireCommand(operateResult.Content1, 23, new byte[]
				{
					b
				});
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = operateResult2;
				}
				else
				{
					OperateResult<byte[]> operateResult3 = base.ReadFromCoreServer(operateResult2.Content);
					bool flag3 = !operateResult3.IsSuccess;
					if (flag3)
					{
						result = operateResult3;
					}
					else
					{
						OperateResult operateResult4 = DLT645.CheckResponse(operateResult3.Content);
						bool flag4 = !operateResult4.IsSuccess;
						if (flag4)
						{
							result = operateResult4;
						}
						else
						{
							bool flag5 = operateResult3.Content[10] == b;
							if (flag5)
							{
								result = OperateResult.CreateSuccessResult();
							}
							else
							{
								result = new OperateResult(StringResources.Language.DLTErrorWriteReadCheckFailed);
							}
						}
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645OverTcp.Write(System.String,System.Byte[])" />
		// Token: 0x06001437 RID: 5175 RVA: 0x00068F00 File Offset: 0x00067100
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, byte[] value)
		{
			DLT645OverTcp.<WriteAsync>d__18 <WriteAsync>d__ = new DLT645OverTcp.<WriteAsync>d__18();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.value = value;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<DLT645OverTcp.<WriteAsync>d__18>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.ReadAddress" />
		// Token: 0x06001438 RID: 5176 RVA: 0x00068F54 File Offset: 0x00067154
		[DebuggerStepThrough]
		public Task<OperateResult<string>> ReadAddressAsync()
		{
			DLT645OverTcp.<ReadAddressAsync>d__19 <ReadAddressAsync>d__ = new DLT645OverTcp.<ReadAddressAsync>d__19();
			<ReadAddressAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<string>>.Create();
			<ReadAddressAsync>d__.<>4__this = this;
			<ReadAddressAsync>d__.<>1__state = -1;
			<ReadAddressAsync>d__.<>t__builder.Start<DLT645OverTcp.<ReadAddressAsync>d__19>(ref <ReadAddressAsync>d__);
			return <ReadAddressAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.WriteAddress(System.String)" />
		// Token: 0x06001439 RID: 5177 RVA: 0x00068F98 File Offset: 0x00067198
		[DebuggerStepThrough]
		public Task<OperateResult> WriteAddressAsync(string address)
		{
			DLT645OverTcp.<WriteAddressAsync>d__20 <WriteAddressAsync>d__ = new DLT645OverTcp.<WriteAddressAsync>d__20();
			<WriteAddressAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAddressAsync>d__.<>4__this = this;
			<WriteAddressAsync>d__.address = address;
			<WriteAddressAsync>d__.<>1__state = -1;
			<WriteAddressAsync>d__.<>t__builder.Start<DLT645OverTcp.<WriteAddressAsync>d__20>(ref <WriteAddressAsync>d__);
			return <WriteAddressAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.BroadcastTime(System.DateTime)" />
		// Token: 0x0600143A RID: 5178 RVA: 0x00068FE4 File Offset: 0x000671E4
		[DebuggerStepThrough]
		public Task<OperateResult> BroadcastTimeAsync(DateTime dateTime)
		{
			DLT645OverTcp.<BroadcastTimeAsync>d__21 <BroadcastTimeAsync>d__ = new DLT645OverTcp.<BroadcastTimeAsync>d__21();
			<BroadcastTimeAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<BroadcastTimeAsync>d__.<>4__this = this;
			<BroadcastTimeAsync>d__.dateTime = dateTime;
			<BroadcastTimeAsync>d__.<>1__state = -1;
			<BroadcastTimeAsync>d__.<>t__builder.Start<DLT645OverTcp.<BroadcastTimeAsync>d__21>(ref <BroadcastTimeAsync>d__);
			return <BroadcastTimeAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.FreezeCommand(System.String)" />
		// Token: 0x0600143B RID: 5179 RVA: 0x00069030 File Offset: 0x00067230
		[DebuggerStepThrough]
		public Task<OperateResult> FreezeCommandAsync(string dataArea)
		{
			DLT645OverTcp.<FreezeCommandAsync>d__22 <FreezeCommandAsync>d__ = new DLT645OverTcp.<FreezeCommandAsync>d__22();
			<FreezeCommandAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<FreezeCommandAsync>d__.<>4__this = this;
			<FreezeCommandAsync>d__.dataArea = dataArea;
			<FreezeCommandAsync>d__.<>1__state = -1;
			<FreezeCommandAsync>d__.<>t__builder.Start<DLT645OverTcp.<FreezeCommandAsync>d__22>(ref <FreezeCommandAsync>d__);
			return <FreezeCommandAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Instrument.DLT.DLT645.ChangeBaudRate(System.String)" />
		// Token: 0x0600143C RID: 5180 RVA: 0x0006907C File Offset: 0x0006727C
		[DebuggerStepThrough]
		public Task<OperateResult> ChangeBaudRateAsync(string baudRate)
		{
			DLT645OverTcp.<ChangeBaudRateAsync>d__23 <ChangeBaudRateAsync>d__ = new DLT645OverTcp.<ChangeBaudRateAsync>d__23();
			<ChangeBaudRateAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<ChangeBaudRateAsync>d__.<>4__this = this;
			<ChangeBaudRateAsync>d__.baudRate = baudRate;
			<ChangeBaudRateAsync>d__.<>1__state = -1;
			<ChangeBaudRateAsync>d__.<>t__builder.Start<DLT645OverTcp.<ChangeBaudRateAsync>d__23>(ref <ChangeBaudRateAsync>d__);
			return <ChangeBaudRateAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="P:HslCommunication.Instrument.DLT.DLT645.Station" />
		// Token: 0x170004DF RID: 1247
		// (get) Token: 0x0600143D RID: 5181 RVA: 0x000690C7 File Offset: 0x000672C7
		// (set) Token: 0x0600143E RID: 5182 RVA: 0x000690CF File Offset: 0x000672CF
		public string Station
		{
			get
			{
				return this.station;
			}
			set
			{
				this.station = value;
			}
		}

		/// <inheritdoc />
		// Token: 0x0600143F RID: 5183 RVA: 0x000690D8 File Offset: 0x000672D8
		public override string ToString()
		{
			return string.Format("DLT645OverTcp[{0}:{1}]", this.IpAddress, this.Port);
		}

		// Token: 0x040004B5 RID: 1205
		private string station = "1";

		// Token: 0x040004B6 RID: 1206
		private string password = "00000000";

		// Token: 0x040004B7 RID: 1207
		private string opCode = "00000000";
	}
}
